<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./dist/include-openlayers-local.js"></script>
    <script src="./libs/gaode.js"></script>
  </head>
  <body>
    <div id="map_container"></div>
    <script>
      var tdKey = '4086e32774bba771f0c76308b759105f'
      var TiandiMap_vec = new ol.layer.Tile({
        title: '天地图矢量图层',
        source: new ol.source.XYZ({
          url:
            'http://t0.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=' +
            tdKey, //parent.TiandituKey()为天地图密钥,
          wrapX: false,
          //解决导出图片
          crossOrigin: 'Anonymous',
        }),
      })
      var TiandiMap_cva = new ol.layer.Tile({
        title: '天地图矢量注记图层',
        source: new ol.source.XYZ({
          url:
            'http://t0.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=' +
            tdKey, //parent.TiandituKey()为天地图密钥
          wrapX: false,
          //解决导出图片
          crossOrigin: 'Anonymous',
        }),
      })
      // 天地图影像图层
      var TiandiMap_img = new ol.layer.Tile({
        title: '天地图影像图层',
        source: new ol.source.XYZ({
          url:
            'http://t0.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=' +
            tdKey,
          wrapX: false,
          crossOrigin: 'Anonymous',
        }),
      })
      // 天地图影像注记图层
      var TiandiMap_cia = new ol.layer.Tile({
        title: '天地图影像注记图层',
        source: new ol.source.XYZ({
          url:
            'http://t0.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=' +
            tdKey,
          wrapX: false,
          crossOrigin: 'Anonymous',
        }),
      })
      var docLayer = new Zondy.Map.Doc('', 'guanggu', {
        ip: 'localhost',
        port: 6163,
      })
      var map = new ol.Map({
        target: 'map_container',
        layers: [
          TiandiMap_img,
          TiandiMap_cia,
          TiandiMap_vec,
          TiandiMap_cva,
          docLayer,
        ],
        view: new ol.View({
          projection: 'EPSG:4326',
          center: [114.3, 30.5],
          zoom: 4,
        }),
      })
    </script>
  </body>
</html>
